﻿# 使用简化的函数来处理url_param
url_param = 'https://ca-times.brightspotcdn.com/75/?url=https%3A%2F%2Fcalifornia-times-brightspot.s3.amazonawsthumb.jpg?v=1703638428&w=960&h=730&vtcrop=y'
# 定义一个映射扩展名和其对应值的字典
extension_mapping = {
    '.js': '.js', '.css': '.css', '.io': '.io', '.rss': '.rss', '.ico': '.ico', '.jpg': '.jpg', '.JPG': '.JPG',
    '.jpeg': '.jpeg', '.JPEG': '.JPEG',
    '.png': '.png', '.PNG': '.PNG', '.gif': '.gif', '.GIF': '.GIF', '.svg': '.svg', '.SVG': '.SVG'
}
for ext, replace_ext in extension_mapping.items():
    if ext in url_param:
        url_param = url_param.split(ext)[0] + replace_ext

print(url_param)
